﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OnlineShop
{
    public class Product : INameable//, IStock//,IBuyable
    {
        private string name;
        private string brand;
        private decimal cost;

        public string Name
        {
            get { return this.name; }
            set 
            {
                if (value == null)
                {
                    throw new ArgumentNullException("Name of product cannot be null.");
                }
                this.name = value;
           }
        }

        public string Brand
        {
            get { return this.brand; }
            set
            {
                if (value == null)
                {
                    throw new ArgumentNullException("Brand of product cannot be null.");
                }
                this.brand = value;
            }
        }

        public decimal Cost
        {
            get { return this.cost; }
            set
            {
                if (value == 0)
                {
                    throw new ArgumentNullException("Cost of product cannot be null.");
                }
                this.cost = value;
            }
        }
    }
}
